<%--
    Document   : menu
    Created on : 16/10/2010, 22:00:31
    Author     : renan
--%>



<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>
<%@page import="seguranca.Credencial"%>
<%@page import="entidades.Usuario"%>
<%@page import="daos.UsuarioDAO"%>

<%
            String login = UsuarioDAO.login;
            String nivel = UsuarioDAO.nivel;
%>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="../../js/funcoes.js"></script>
    <link rel="stylesheet" type="text/css" href="../../css/style.css">
    <title>Menu Administrativo</title>
</head>
<f:view>
    <h:form>
        <html>
            <body>
                <div>
                    <table align="left">
                        <img align="left" alt="" title="indentificação" src="../../imagens/identity.png">
                        <td>
                            <b><span style="font-size:12px">USUÁRIO</span>&nbsp;-&nbsp;</b><span class="infsistema"><%=login%></span>&nbsp;
                            <b><span style="font-size:12px">PEFIL</span>&nbsp;-&nbsp;</b><span class="infsistema"><%=nivel%></span>
                        </td>
                    </table>
                    <table style="padding-left: 15%;">
                        <tr>
                            <td>
                                <a4j:commandButton title="Manutenção de Usuários" image="../../imagens/usuario.png" actionListener="#{usuarioFrm.paramNavegacao}"  action="#{usuarioFrm.entrar}"  oncomplete="navegarUsuario();"/>
                            </td>
                            <td>
                                <a4j:commandButton title="Manutenção de Quartos" image="../../imagens/quarto.png" action="#{quartoFrm.entrar}" oncomplete="navegarQuarto();"/>
                            </td>
                            <td>
                                <a4j:commandButton title="Manutenção de Reservas" image="../../imagens/reser.png" action="#{reservaFrm.entrar}" oncomplete="navegarReserva();"/>
                            </td>
                        </tr>
                    </table>
                </div>
                <div style="background-image: url(../../imagens/Logo.jpg); height: 500px; background-repeat: no-repeat; background-position: center;"></div>
            </body>
            <script type="text/javascript">
                var contexto = '<%=(request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/")%>';
                var listaUsuario = null;
                function navegarUsuario() {
                    if (listaUsuario == null || listaUsuario.closed) {
                        listaUsuario= novaJanela(contexto+'paginas/cadastro/usuario.faces',
                        'navegacaoUsuario',650,570,'false','center');
                    }
                    listaUsuario.focus();
                }

                var listaQuarto = null;
                function navegarQuarto() {
                    if (listaQuarto == null || listaQuarto.closed) {
                        listaQuarto= novaJanela(contexto+'paginas/cadastro/quarto.faces',
                        'navegacaoQuarto',650,570,'false','center');
                    }
                    listaQuarto.focus();
                }

                var listaReserva = null;
                function navegarReserva() {
                    if (listaReserva == null || listaReserva.closed) {
                        listaReserva= novaJanela(contexto+'paginas/reserva/reserva.faces',
                        'navegacaoReserva',650,570,'false','center');
                    }
                    listaReserva.focus();
                }

                function fechando() {
                    if(listaUsuario !=null){
                        listaUsuario.close();
                    }

                    if(listaQuarto != null){
                        listaQuarto.close();
                    }

                    if(listaReserva != null){
                        listaReserva.close();
                    }
                }

            </script>
        </html>
    </h:form>
</f:view>


